<template>
  <div>
    <van-search placeholder="请输入搜索关键词" @focus="toSearch" />
    <!-- 切换 -->
    <van-tabs>
      <van-tab :title="v.title" v-for="v in tabs" :key="v.id">
        <List :list="v.children"/>
      </van-tab>
    </van-tabs>
  </div>
</template>


<script>
import List from '@/components/List'
import { mapState, mapActions } from "vuex";
export default {
  name: "Index",
  methods: {
    ...mapActions(["Fetch_Tabs"]),
    toSearch() {
      this.$router.push("/search");
    },
  },
  computed: {
    ...mapState(["tabs"])
  },
  created() {
    this.Fetch_Tabs();
  },
  components: {
    List
  }
};
</script>

